package com.ali.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * 业务异常
 *
 * @author jack.wu
 * @version 1.0
 * @date 2020/5/27
 */

public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    @Getter
    @Setter
    private int code = 500;

    @Getter
    @Setter
    private String msg;


    public ServiceException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public ServiceException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public ServiceException(int code, String msg, Throwable t) {
        super(msg, t);
        this.code = code;
        this.msg = msg;
    }
}
